INPUT "enter n: ", n
DIM a(n)
FOR i = 1 TO n
a(i) = INT(RND * 100)
NEXT
imin = 1
min = a(1)
imax = 1
max = a(1)
FOR i = 2 TO n
IF a(i) < min THEN min = a(i): imin = i
IF a(i) > max THEN max = a(i): imax = i
NEXT
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "min = a("; imin; ") ="; min
PRINT "max = a("; imax; ") ="; max
FOR i = 1 TO n
x = a(i)
j = i - 1
WHILE j > 0 AND a(j) < x
a(j + 1) = a(j)
j = j - 1
WEND
a(j + 1) = x
NEXT
FOR i = 1 TO n
PRINT a(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )